package com.webmagic.house.mapper;

import com.webmagic.house.bean.Project;
import com.webmagic.house.bean.Sale;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SaleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Sale record);

    int insertSelective(Sale record);

    Sale selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Sale record);

    int updateByPrimaryKey(Sale record);
    @Select("SELECT * FROM sale where lisence_no = #{no} limit 1")
    Sale selectByLisenceNo(@Param("no")String no);

    @Select("SELECT project.* FROM sale left join project on sale.project_id = project.project_id where sale.open_date>=#{beginDate} and sale.open_date<=#{beginDate} ")
    List<Project> selectPorjectByDate(@Param("beginDate")String beginDate,@Param("endDate")String endDate);

}